<?php
namespace Home\Model;
use Think\Model\MongoModel;
Class BookModel extends MongoModel {
	Protected $pk = 'id';
	Protected $_idType = self::TYPE_OBJECT;
	
	public function get_book_list()
	{
		return M('book')->order("_id desc")->select();
	}
	
	public function find_book($id)
	{
		$MongoId = new \MongoId($id);
		$res = M('book')->where(array('_id'=>$MongoId))->select();
		//echo  M('book')->getLastSql();
		return $res;
	}
}